<template>
  <div id="app">
    <p style="margin-top: 200px">订单已完成</p>
    <p style="font-size: 14px;color: #666;margin-top: 5px">您需支付 <span style="font-size: 22px">{{ price }}</span> 元</p>
    <div style="padding: 5px 15px;background-color: #22c250;color: #FFF;width: 80px;margin: 0 auto;border-radius: 5px;margin-top: 10px">立即支付</div>
  </div>
</template>

<script>
import {orderForecast} from "../../api";

export default {
  name: "orderEnd",
  data() {
    return {
      price: 0.0
    }
  },
  created() {
    let _this = this
    orderForecast({
      params: {
        'startLongitude': _this.$store.state.startLocation.lng,
        'startLatitude': _this.$store.state.startLocation.lat,
        'targetLongitude': _this.$store.state.endLocation.lng,
        'targetLatitude': _this.$store.state.endLocation.lat
      }
    }).then(data => {
      _this.price = Math.ceil(data.result * 10) / 10
    }).error(err => {

    })
  }
}
</script>

<style scoped>

</style>
